import {defineStore} from 'pinia';

export const useCounter = defineStore('counter',{
    state:() =>{
        return {
            count:0
        }
    },
    getters:{
        oddOrEven:(state) =>{
            return state.count % 2 == 1 ? '奇数' : '偶数'
        }
    },
    actions:{
        add() {
            this.count++
        }
    },
});